﻿using System.Collections;
using UnityEngine;
using System.Collections.Generic;
using VoxelBlock.VoxelBlock3D;
using VoxelBlock;using Vector3Int = VoxelBlock.Vector3Int;

public abstract class OperationImplement
{
   
    protected bool isStop;

    protected List<SimpleVoxel> historyRecordFrontList = new List<SimpleVoxel>();
    protected List<SimpleVoxel> historyRecordBreakList = new List<SimpleVoxel>();

    protected ProxyOperation proxy;

    protected DrawVoxel3DCore nowDrawVoxel3DCore;

    public bool IsStop
    {
        set
        {
            isStop = value;
        }
    }

    public OperationImplement()
    {
        //this.proxy = proxy;
        //this.nowDrawVoxel3DCore = nowDrawVoxel3DCore;
    }

    public virtual void Start(StartArg arg)
    {
        this.nowDrawVoxel3DCore = arg.nowDrawVoxel3DCore;
        this.proxy = arg.proxy;
    }

    public abstract void Run(RunArg arg);

    public abstract void Over(OverArg arg);

    public class StartArg
    {
        public Vector3Int StartPosition;
        public int nowSelectUVKey;
        public DrawVoxel3DCore nowDrawVoxel3DCore;
        public VoxelCategories.OperationSelectOperator selectOperator;
        public StartSliceArg startSliceArg;
        public ProxyOperation proxy;
        public StartArg(){}
    }
    
    public class StartSliceArg
    {
        private bool is8;
        private bool getColor;
        private bool setColor;

        public bool Is8
        {
            get
            {
                return is8;
            }

            set
            {
                is8 = value;
                UserData.Thas.Is8_StartSliceArg = value;
            }
        }

        public bool GetColor
        {
            get
            {
                return getColor;
            }

            set
            {
                getColor = value;
                UserData.Thas.GetColor_StartSliceArg = value;
            }
        }

        public bool SetColor
        {
            get
            {
                return setColor;
            }

            set
            {
                setColor = value;
                UserData.Thas.SetColor_StartSliceArg = value;
            }
        }
    }

    public class RunArg
    {
        public Vector3Int gestureStartPosition;
        public Vector3Int updateStartPosition;
        public Vector3Int nowSelectPosition;
        public int nowSelectUVKey;
        public RunArg() { }
        public RunArg(Vector3Int gestureStartPosition, Vector3Int updateStartPosition, Vector3Int nowSelectPosition, int nowSelectUVKey)
        {
            this.gestureStartPosition = gestureStartPosition;
            this.updateStartPosition = updateStartPosition;
            this.nowSelectPosition = nowSelectPosition;
            this.nowSelectUVKey = nowSelectUVKey;
        }
    }

    public class OverArg
    {
        public Vector3Int gestureStartPosition;
        public Vector3Int updateStartPosition;
        public Vector3Int nowSelectPosition;
        public int nowSelectUVKey;
        public OverArg() { }
        public OverArg(Vector3Int gestureStartPosition, Vector3Int updateStartPosition, Vector3Int nowSelectPosition, int nowSelectUVKey)
        {
            this.gestureStartPosition = gestureStartPosition;
            this.updateStartPosition = updateStartPosition;
            this.nowSelectPosition = nowSelectPosition;
            this.nowSelectUVKey = nowSelectUVKey;
        }
    }

}
